package com.module.third.bean.push;


import androidx.annotation.Keep;

import com.google.gson.Gson;
import com.module.third.ThirdUtil;
import com.module.third.bean.IThirdType;

@Keep
public class PushData<T> {
    public PushData(int type, T content) {
        this(com.module.third.learcloud.MyLCUtils2Kt.getAction(), type, content);
    }

    public PushData(String action, int type, T content) {
        this.action = action;
        this.name = "LeanCloud.";
        this.type = type;
        this.content = content;
    }

    private String action;
    private String name;
    private @IPushType.IPush
    int type;
    private @IThirdType.IJump
    int jump;
    private T content;

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public void setType(@IPushType.IPush int type) {
        this.type = type;
    }

    public @IPushType.IPush
    int getType() {
        return type;
    }

    public T getData(Class<T> tClass) {
        return (T) getGson().fromJson(getGson().toJson(content), tClass);
    }

    public void setData(T content) {
        this.content = content;
    }

    public Gson getGson() {
        return ThirdUtil.getGson();
    }

    public int getJump() {
        return jump;
    }

    public void setJump(int jump) {
        this.jump = jump;
    }
}
